if(WIN32)
    LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lib/Release)
else()
    LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/lib)
endif()
add_executable(CybertronNodeTimer "")
include_directories("${CYBERTRON_PATH_SOURCE}/CoreLibrary/include")
include_directories("${CYBERTRON_PATH_ROOT}/3rdparty/asio")
include_directories("${CYBERTRON_PATH_ROOT}/3rdparty")
include_directories("${CYBERTRON_PATH_ROOT}/3rdparty/gtest/include")
include_directories("${CYBERTRON_PATH_SOURCE}/Protocol/Output/cpp")
include_directories("${CYBERTRON_PATH_ROOT}/3rdparty/libcurl/include")
IF (WIN32)
  include_directories("${CYBERTRON_PATH_ROOT}/3rdparty/superdog/windows/x64")
ELSEIF (UNIX)
  include_directories("${CYBERTRON_PATH_ROOT}/3rdparty/superdog/linux/x86_64")
ENDIF()
include_directories("${CYBERTRON_PATH_ROOT}/3rdparty/libb64-1.2/include")

IF (WIN32)
  add_definitions(-D_WIN32_WINNT=0x0501)
ENDIF()

add_definitions(-DNOMINMAX)
add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)
add_definitions(-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)

file(GLOB_RECURSE srcs *.h *.hh *i *.hpp *.c *.cc *.cpp)
target_sources(CybertronNodeTimer PRIVATE ${srcs})
source_group(Source FILES ${srcs})

SetDefaultTargetProperties(CybertronNodeTimer)

if (WIN32)
target_link_libraries(CybertronNodeTimer advapi32
       iphlpapi
       psapi
       shell32
       user32
       userenv
       ws2_32
       crypt32    #for libcurl
       Wldap32    #for libcurl
       Normaliz   #for libcurl
	   pdh # for pdh_util/query.cpp
       ${CYBERTRON_PATH_ROOT}/3rdparty/libcurl/lib_win_x64/libcurl_a.lib)
else()
target_link_libraries(CybertronNodeTimer pthread)
target_link_libraries(CybertronNodeTimer rt)
endif()

target_link_libraries(CybertronNodeTimer CybertronCore)
target_link_libraries(CybertronNodeTimer protobuf)
IF (WIN32)

  # target_link_libraries(CybertronNodeTimer dog_windows_x64_demo)
ELSEIF (UNIX)
  # target_link_libraries(CybertronNodeTimer dog_linux_x86_64_demo)
  target_link_libraries(CybertronNodeTimer ${CYBERTRON_PATH_ROOT}/3rdparty/libcurl/lib_linux_x64/libcurl.a)
ENDIF()

IF (MSVC)
  SET_PROPERTY(TARGET CybertronNodeTimer PROPERTY FOLDER "Worker")
ENDIF()
